﻿using System;

namespace VASJ.Common
{
    //
    // Refer: http://www.anujvarma.com/c-net-exception-handling-best-practices/
    //
    public class CustomException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public CustomException()
            : base()
        {
        }

        public CustomException(string message, Exception innerException)
            : base(message, innerException)
        {
            if (innerException != null)
            {
                message += innerException.ToString();
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CustomException"/> class with a specified error message.
        /// </summary>
        /// <param name="message">The error message that explains the reason for the exception.</param>
        public CustomException(string message)
            : base(message)
        {
        }
    }
}
